package com.gxa.insurance.controller;

import com.gxa.insurance.pojo.Coupon;
import com.gxa.insurance.pojo.ReceiveExchangeCode;
import com.gxa.insurance.service.ReceiveExchangeCodeService;
import com.gxa.insurance.util.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author lijunlin
 * @date 2022/6/8
 */
@Api(value = "关联顾客兑换码的api接口")
@RestController
@RequestMapping("/receiveexchangecode")
@CrossOrigin
public class ReceiveExchangeCodeController {
    @Autowired
    ReceiveExchangeCodeService receiveExchangeCodeService;

    @ApiOperation(value = "关联顾客兑换码的方法",produces = "body")
    @PostMapping("/insertreceive")
    public Map insert(@RequestBody ReceiveExchangeCode receiveExchangeCode){
        receiveExchangeCodeService.insert(receiveExchangeCode);
        JsonResult jsonResult = new JsonResult();
        jsonResult.setCode("1");
        jsonResult.setMsg("兑换码发送成功");
        return jsonResult.getMap();
    }
}
